1. Field of the Invention
The present invention relates to signal sampling method, data encryption/decryption method and electronic device utilizing the methods, and more particularly, to a signal sampling method for calculating an interval of voltage level transition of input signal in order to set up phase of input signal or sampling clock signal, data encryption/decryption method and electronic device utilizing the methods.
2. Description of the Prior Art
Conditional access module (CAM) is utilized to decrypt encrypted image data. PCMCIA (personal computer memory card international association) cards for digital televisions (TV) are exemplary species of CAM. For example, after paying fee to digital TV premium channel operator, CAM equipped with decryption chip is provided to user. In another example, corresponding decryption program or serial code is provided by operator if user owns CAM already. Therefore the CAM is capable to decrypt the television data stream encrypted by operator.
The classic decryption flow of CAM could be categorized into two kinds. First, the decrypted TV data stream is stored and encrypted again by another encryption method. Once user wants, the stored and encrypted TV data stream would be decrypted and played. In this example, the locally encrypted TV data stream is stored in a storage device other than CAM. It is possible to retrieve the encrypted TV data stream from the separate storage device and to manipulate and decrypt the stolen TV data stream. In such architecture, the protection to TV data stream is not very well. In alternative architecture, the encrypted TV data stream is stored without being decrypted. Once user wants to play, the stored encrypted TV data stream is sent to CAM for decryption and play. Since operator is required to provide CAM or associated information for decrypting the TV data stream in the second scenario, the protective strength is stronger than the first one.
Please refer to FIG. 1, which is a block diagram of a digital TV device 100 equipped with CAM in the prior art. The digital TV device 100 adopted the mentioned second mechanism, i.e., the encrypted TV data stream is stored without being decrypted and is sent to CAM for decryption and play. As shown in FIG. 1, the digital TV device 100 comprises an antenna 101, a tuner 103, a demodulator 105, a data access control device 107, and a CAM 109. The antenna 101 is configured to receive TV data signal comprising signal encrypted by channel operator. The tuner 103 is configured to tune the frequency to receive a specified channel. The demodulator 105 receives TV data signal from the tuner 103, demodulates the input signal and performs channel calibration, synchronization, forward error connection, channel encoding, and etc. Because the tuner 103 and the demodulator 105 in the digital TV device 100 are well-known to one with ordinary skill in the art, the present invention has no further discussions on them. The original TV data (SD) such as MPEG (Motion Picture Experts Group) transport stream processed by the tuner 103 and the demodulator 105 is transmitted to the data access control device 107. As mentioned above, the original TV data (SD) is stored in the data access control device 107. Once the data access control device 107 receives an output command, the stored original TV data SD′ is outputted to the CAM 109 for decryption and the decrypted TV data CD is generated accordingly. The decrypted TV data CD may be sent directly to display or manipulated by some sorts of image processing such as image timing calibration or image contrast enhancement. In some applications, the decrypted TV data CD may be sampled as sampled TV data SCD according to sampling clock signal CLKs for further uses.
After decryption steps performed on the original TV data SD′ by the CAM 109, the timing of the decrypted TV data CD may be drifted from the original TV data SD′ due to the influence of internal signal paths and loads of CAM 109. As a result, the voltage level transition timing may be drifted accordingly. Take FIG. 2 as an example, the voltage level transition timings of the original TV data SD′ are at T1 and T2. After decryption procedure processed by the CAM 109, the voltage level transition timing of the decrypted TV data CD are shifted to T1′ and T2′. In case of sampling point SP2, it falls in the interval with no voltage change. Hence the sampled value of the sampling point SP2 is correct. However, in case of sampling point SP1, it samples on the voltage level transition timing T1′. The sampled value may be wrong comparing to sampling the original timing T1. Furthermore, since internal signal paths and loads of various CAM 109 manufactured by different vendors are not the same, it is difficult to calibrate timing shift error of each CAM 109.
From the above it is clear that prior art still has shortcomings. In order to solve these problems, efforts have long been made in vain, while ordinary products and methods offering no appropriate structures and methods. Thus, there is a need in the industry for a novel technique that solves these problems.